package com.leyou.search.feignclient.impl;

import com.leyou.search.feignclient.ItemClient;
import com.sun.org.apache.xpath.internal.operations.String;
import feign.hystrix.FallbackFactory;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @version V1.0
 * @author: Ljxpa
 * @date: 2020/03/12 23:24
 * @description:
 */
public class DemoFallBackFactory implements FallbackFactory<ItemClient> {
	@Override
	public ItemClient create(Throwable throwable) {


		return null;


	}

	public static void main(String[] args) throws IOException {
		ServerSocket serverSocket = new ServerSocket(9000);
		Socket accept = serverSocket.accept();
		InputStream inputStream = accept.getInputStream();
		byte[] bytes = new byte[1024];
		while (true) {
			int read = inputStream.read(bytes);
			if(read != -1){
				System.out.println(new java.lang.String(bytes));
			}else{
				break;
			}

		}
	}
}
